{extend name="default/base/base_seller" /}
{block name="seller_btn"}
<a href="{:url('Sellergoodsadd/index')}" class="dssc-btn dssc-btn-green" title="{$Think.lang.store_goods_index_add_goods}"> {$Think.lang.store_goods_index_add_goods}</a>
{/block}
{block name="seller_main"}
<form method="get" action="">
    <table class="search-form">
        <tr>
            <td>&nbsp;</td>
            <th>{$Think.lang.store_goods_index_store_goods_class}</th>
            <td class="w160"><select name="storegc_id" class="w150">
                    <option value="0">{$Think.lang.ds_please_choose}</option>
                    {notempty name="store_goods_class"}
                    {foreach name="store_goods_class" item="val"}
                    <option value="{$val.storegc_id}" {if $Request.get.storegc_id == $val.storegc_id}selected=selected{/if}>{$val.storegc_name}</option>
                    {if isset($val['child']) && count($val['child'])>0}
                    {foreach name="$val.child" item="child_val"  }
                    <option value="{$child_val.storegc_id}" {if $Request.get.storegc_id == $child_val.storegc_id}selected=selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;{$child_val.storegc_name}</option>
                    {/foreach}
                    {/if}
                    {/foreach}
                    {/notempty}
                </select></td>
            <th>{$Think.lang.store_goods_index_stock}</th>
            <td class="w110">
                <select name="stock">
                    <option value="" {if condition="$Request.param.stock"}selected="selected"{/if}>{$Think.lang.ds_please_choose}</option>
                    <option value="1" {if condition="$Request.param.stock eq '1'"}selected="selected"{/if}>{$Think.lang.store_goods_index_stock_warning}</option>
                </select>
            </td> 
            <th> <select name="search_type">
                    <option value="0" {if condition="$Request.param.type eq '0'"}selected="selected"{/if}>{$Think.lang.store_goods_index_goods_name}</option>
                    <option value="1" {if condition="$Request.param.type eq '1'"}selected="selected"{/if}>{$Think.lang.store_goods_index_goods_no}</option>
                    <option value="2" {if condition="$Request.param.type eq '2'"}selected="selected"{/if}>{$Think.lang.platform_article_number}</option>
                </select>
            </th>
            <td class="w160"><input type="text" class="text w150" name="keyword" value="{$Request.param.keyword}"/></td>
            <td class="tc w70">
                <input type="submit" class="submit" value="{$Think.lang.ds_search}" />
            </td>
        </tr>
    </table>
</form>


<table class="dssc-default-table">
    <thead>
        <tr ds_type="table_header">
            <th class="w30">&nbsp;</th>
            <th class="w50">&nbsp;</th>
            <th coltype="editable" column="goods_name" checker="check_required" inputwidth="230px">{$Think.lang.store_goods_index_goods_name}</th>
            <th class="w100">{$Think.lang.store_goods_index_price}</th>
            <th class="w100">{$Think.lang.store_goods_index_stock}</th>
            <th class="w100">{$Think.lang.store_goods_index_add_time}</th>
            <th class="w120">{$Think.lang.ds_handle}</th>
        </tr>
        {notempty name="goods_list"}
        <tr>
            <td class="tc"><input type="checkbox" id="all" class="checkall"/></td>
            <td colspan="6"><label for="all" >{$Think.lang.ds_select_all}</label>
                <a href="javascript:void(0);" class="dssc-btn-mini" ds_type="batchbutton" uri="{:url('Sellergoodsonline/drop_goods')}" name="commonid" confirm="{$Think.lang.ds_ensure_del}"><i class="iconfont">&#xe725;</i>{$Think.lang.ds_del}</a>
                <a href="javascript:void(0);" class="dssc-btn-mini" ds_type="batchbutton" uri="{:url('Sellergoodsonline/goods_unshow')}" name="commonid">{$Think.lang.store_goods_index_unshow}</a>
                <a href="javascript:void(0);" class="dssc-btn-mini" dstype="batch" data-param="{urls:'{:url('Sellergoodsonline/edit_jingle')}', sign:'jingle'}"><i></i>{$Think.lang.advertising}</a>
                <a href="javascript:void(0);" class="dssc-btn-mini" dstype="batch" data-param="{urls:'{:url('Sellergoodsonline/edit_plate')}', sign:'plate'}"><i></i>{$Think.lang.set_associated_layout}</a>
            </td>
        </tr>
        {/notempty}
    </thead>
    <tbody>
        {notempty name="goods_list"}
        {foreach name="goods_list" item="val" }
        <tr>
            <th class="tc"><input type="checkbox" class="checkitem tc" value="{$val.goods_commonid}"/></th>
            <th colspan="20">{$Think.lang.platform_article_number}：{$val.goods_commonid}</th>
        </tr>
        <tr>
            <td class="trigger"><i class="tip iconfont" dstype="ajaxGoodsList" data-comminid="{$val.goods_commonid}" title="{$Think.lang.click_check_goods}">&#xe6db;</i></td>
            <td><div class="pic-thumb"><a href="{:url('Goods/index',['goods_id'=>$val.goods_id])}" target="_blank"><img src="{:goods_thumb($val, 240)}"/></a></div></td>
            <td class="tl"><dl class="goods-name">
                    <dt style="max-width: 450px !important;">
                        <a href="{:url('Goods/index',['goods_id'=>$val.goods_id])}" target="_blank">{$val.goods_name}</a></dt>
                    <dd>{$Think.lang.store_goods_index_goods_no}{$Think.lang.ds_colon}{$val.goods_serial}</dd>
                    <dd class="serve"> <span class="{if $val.goods_commend == 1}open{/if}" title="{$Think.lang.shop_recommendation}"><i class="commend">{$Think.lang.commend}</i></span> <span class="{if $val.mobile_body != ''}open{/if}" title="{$Think.lang.details_products_mobile_phones}"><i class="iconfont">&#xe601;</i></span> <span class="" title="{$Think.lang.product_page_qr_code}"><i class="iconfont">&#xe72d;</i>
                            <div class="QRcode"><a target="_blank" href="{:goods_qrcode(array('goods_id' => $val.goods_id))}">{$Think.lang.download_label}</a>
                                <p><img src="{:goods_qrcode(array('goods_id' => $val.goods_id))}"/></p>
                            </div>
                        </span>
                        {notempty name="$val.goods_type_cn"}
                        <span class="sale-type" style="color:#fff">{$val.goods_type_cn}</span>
                        {/notempty}
                    </dd>
                </dl></td>
            <td{if $val.goods_lock == 0} class="hover" ds_type="dialog" dialog_width="720" dialog_id="edit_storage" dialog_title="{$Think.lang.edit_storage}" uri="{:url('Sellergoodsonline/edit_storage',['commonid'=>$val.goods_commonid])}"{/if}><span>{$Think.lang.currency|raw}{$val.goods_price}</span><i class="iconfont hidden">&#xe731;</i></td>
            <td class="hover" ds_type="dialog" dialog_width="720" dialog_id="edit_storage" dialog_title="{$Think.lang.edit_storage}" uri="{:url('Sellergoodsonline/edit_storage',['commonid'=>$val.goods_commonid])}"><span {if isset($val.alarm)}style="color:red;"{/if}>{$val.sum}{$Think.lang.piece}</span><i class="iconfont hidden">&#xe731;</i></td>
            <td class="goods-time">{$val.goods_addtime|date="Y-m-d"}</td>
            <td class="dscs-table-handle">
                {if $val.goods_lock == 0}
                <span><a href="{:url('Sellergoodsonline/edit_goods',['commonid'=>$val.goods_commonid])}" class="btn-blue"><i class="iconfont">&#xe731;</i>
                        <p>{$Think.lang.ds_edit}</p>
                    </a></span> <span><a href="javascript:void(0);" onclick="ds_ajaxget_confirm('{:url('Sellergoodsonline/drop_goods',['commonid'=>$val.goods_commonid])}','{$Think.lang.ds_ensure_del}');" class="btn-red"><i class="iconfont">&#xe725;</i>
                        <p>{$Think.lang.ds_del}</p>
                    </a></span>
                {else /}
                <span class="tip" title="{$Think.lang.participate_activity_operation}"><a readonly="readonly" class="btn-orange-current"><i class="iconfont">&#xe768;</i>
                        <p>{$Think.lang.lock}</p>
                    </a></span>
                {/if}
            </td>
        </tr>
        <tr style="display:none;">
            <td colspan="7"><div class="dssc-goods-sku ps-container"></div></td>
        </tr>
        {/foreach}
        {else /}
        <tr>
            <td colspan="7" class="norecord"><div class="warning-option"><i class="iconfont">&#xe64c;</i><span>{$Think.lang.no_record}</span></div></td>
        </tr>
        {/notempty}
    </tbody>
    <tfoot>
        {notempty name="goods_list"}
        <tr>
            <th class="tc"><input type="checkbox" id="all2" class="checkall"/></th>
            <th colspan="6"><label for="all2">{$Think.lang.ds_select_all}</label>
                <a href="javascript:void(0);" ds_type="batchbutton" uri="{:url('Sellergoodsonline/drop_goods')}" name="commonid" confirm="{$Think.lang.ds_ensure_del}" class="dssc-btn-mini"><i class="iconfont">&#xe725;</i>{$Think.lang.ds_del}</a>
                <a href="javascript:void(0);" ds_type="batchbutton" uri="{:url('Sellergoodsonline/goods_unshow')}" name="commonid" class="dssc-btn-mini">{$Think.lang.store_goods_index_unshow}</a>
                <a href="javascript:void(0);" class="dssc-btn-mini" dstype="batch" data-param="{urls:'{:url('Sellergoodsonline/edit_jingle')}', sign:'jingle'}"><i></i>{$Think.lang.advertising}</a>
                <a href="javascript:void(0);" class="dssc-btn-mini" dstype="batch" data-param="{urls:'{:url('Sellergoodsonline/edit_plate')}', sign:'plate'}"><i></i>{$Think.lang.set_associated_layout}</a>
            </th>
        </tr>
        <tr>
            <td colspan="7"><div class="pagination"> {$show_page|raw}</div></td>
        </tr>
        {/notempty}
    </tfoot>
</table>
<script src="{$Think.HOME_SITE_ROOT}/js/store_goods_list.js"></script> 

<script>
            $(function () {
                $('a[dstype="batch"]').click(function () {
                    if ($('.checkitem:checked').length == 0) {    //没有选择
                        layer.alert('{$Think.lang.select_record_want_operate}');
                        return false;
                    }
                    var _items = '';
                    $('.checkitem:checked').each(function () {
                        _items += $(this).val() + ',';
                    });
                    _items = _items.substr(0, (_items.length - 1));

                    var data_str = '';
                    eval('data_str = ' + $(this).attr('data-param'));

                    if (data_str.sign == 'jingle') {
                        ajax_form('ajax_jingle', '{$Think.lang.advertising}', data_str.urls + '?commonid=' + _items + '&inajax=1', '480');
                    } else if (data_str.sign == 'plate') {
                        ajax_form('ajax_plate', '{$Think.lang.set_associated_layout}', data_str.urls + '?commonid=' + _items + '&inajax=1', '480');
                    }
                });
            });
</script>


{/block}
